package com.glsc.ngateway.oaflow.wsclients.wsdl.workflow;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.ws.client.core.support.WebServiceGatewaySupport;

public class WsClient extends WebServiceGatewaySupport {

    @Autowired
    WsdlConfiguration wsdlConfiguration;

    @Value("${oawebserviceSecond.url}")
    private String oawebserviceSecondUrl;

    public Object callWebService(Object request) {
        return getWebServiceTemplate().marshalSendAndReceive(wsdlConfiguration.getOawebserviceUrl(), request);
    }

    public Object callWebServiceBack(Object request) {
        return getWebServiceTemplate().marshalSendAndReceive(oawebserviceSecondUrl, request);
    }
}
